#include <stdio.h>

/*数制转换*/

void printb(int x,int n);

void main()
{
    int x;
    printf("Input number:");
    scanf("%d",&x);
    printf("number of decimal from: %d\n",x);
    printf("    is binary from: ");
    printb(x,sizeof(int)*8);
    putchar('\n');

}

void printb(int x,int n)
{
    if(n>0)
    {
        putchar('0'+((unsigned)(x&(1<<(n-1)))>>(n-1)));
        printb(x,n-1);

    }
}
